package com.palm.hubo2o.ui;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.AutoCompleteTextView;
import android.widget.EditText;
import com.palm.hubo2o.BaseActivity;
import com.palm.hubo2o.R;
import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;



public class WithdrawActivity extends BaseActivity {

    //提现


    @Bind(R.id.money)
    AutoCompleteTextView mPhone;
    @Bind(R.id.password)
    EditText mPassword;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_withdraw);
        ButterKnife.bind(this);
    }


    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (android.R.id.home == item.getItemId()) {
            finish();
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    @OnClick({ R.id.sign_in_button})
    public void onClick(View view) {
        switch (view.getId()) {

            case R.id.sign_in_button:
                //提现

                break;
            default:
                break;
        }
    }

//    private void login(final String mobile, final String password) {
//        final ProgressDialogCompat progress = new ProgressDialogCompat(this);
//        progress.show();
//        LoginData data = new LoginData();
//        data.setMobile(mobile);
//        data.setPassword(MD5.md5(password).substring(0, 16).toUpperCase());
//        progress.setMessage(getString(R.string.prompt_login_loading));
//        Call<Result<User>> call = PalmRetrofit.getInstance().getApi().login(new Request<>(data));
//        call.enqueue(new PalmCallBack<User>(this) {
//            @Override
//            public void succeed(User user) {
//                if (!progress.isCanceled()) {
//                    PalmSession.setSession(user);
//                    if (mRememberPhone.isChecked())
//                        Settings.put(String.valueOf(mRememberPhone.getId()), mobile);
//                    if (mRememberPassword.isChecked())
//                        Settings.put(String.valueOf(mRememberPassword.getId()), Base64.encodeToString(password.getBytes(), Base64.DEFAULT));
//                    progress.dismiss();
//                    setResult(RESULT_OK);
//                    finish();
//                }
//            }
//
//            @Override
//            public void failed(String message) {
//                if (!progress.isCanceled()) {
//                    progress.dismiss();
//                    Toast.makeText(getContext(), StringUtils.isEmpty(message) ? getString(R.string.prompt_login_failed) : message, Toast.LENGTH_SHORT).show();
//                }
//            }
//        });
//    }
}

